Skip to content

chore(node-client): Implement NodeClient and createClient entry point#1416

Open
joker23 wants to merge 5 commits into
mainfrom
skz/sdk-2195/node-client-sdk-next-port-client-client-impl
Open

chore(node-client): Implement NodeClient and createClient entry point#1416
joker23 wants to merge 5 commits into
mainfrom
skz/sdk-2195/node-client-sdk-next-port-client-client-impl

Conversation

@joker23
Copy link
Copy Markdown
Contributor

@joker23 joker23 commented Jun 4, 2026

This PR will:

  • Implement data manager
  • Implement LD client
  • Implement main entrypoints for the sdk

Note

Medium Risk
New SDK surface affecting flag loading, streaming/polling, and identify timing; logic is heavily tested but changes core client initialization and connection behavior.

Overview
Implements the functional @launchdarkly/node-client-sdk package by replacing the placeholder entry point with createClient, NodeClient (on shared LDClientImpl), and NodeDataManager for streaming/polling/offline, bootstrap, and identify lifecycle.

NodeDataManager applies bootstrap without reading cache, can open streaming/polling after bootstrap without tying identify to the network, serializes setConnectionMode, and rejects in-flight identify on close, offline, or mode switches so callers do not hang on timeouts. NodeClient wires connection mode to flush/event sending and defaults identify to sheddable.

The package index now documents and exports the public API; release-please no longer bumps version in index.ts. Broad Jest coverage uses a mock platform for data sources, bootstrap, events, and races.

Reviewed by Cursor Bugbot for commit 095b0fc. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26365 bytes
Compressed size limit: 29000
Uncompressed size: 129044 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179579 bytes
Compressed size limit: 200000
Uncompressed size: 831422 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 38739 bytes
Compressed size limit: 39000
Uncompressed size: 212244 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31978 bytes
Compressed size limit: 34000
Uncompressed size: 114243 bytes

@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented Jun 4, 2026

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit ac79085. Configure here.

@joker23 joker23 marked this pull request as ready for review June 4, 2026 18:45
@joker23 joker23 requested a review from a team as a code owner June 4, 2026 18:45
devin-ai-integration[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

// preventing a stale reject from firing if setConnectionMode runs after resolution.
const wrappedResolve = identifyResolve
? () => {
this._pendingIdentifyReject = undefined;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to leave this in as a way to handle the edge case described in the comments... I do think that we can get rid of this handling and just let the previous identify timeout or be shedded.

@joker23 joker23 force-pushed the skz/sdk-2195/node-client-sdk-next-port-client-client-impl branch from b3127f2 to ad986dd Compare June 5, 2026 21:24
cursor[bot]

This comment was marked as resolved.


// Serializes connection-mode transitions so concurrent calls cannot leave event-sending
// state out of sync with the active connection mode.
private _connectionModeQueue: Promise<void> = Promise.resolve();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it would be inside the data manager.

cursor[bot]

This comment was marked as resolved.

joker23 added 5 commits June 8, 2026 14:55
put in the for ordering
fixing up the race conditions that could happen when connection mode is
changed during identify
@joker23 joker23 force-pushed the skz/sdk-2195/node-client-sdk-next-port-client-client-impl branch from fb90a0c to 095b0fc Compare June 8, 2026 18:55
@joker23 joker23 requested a review from kinyoklion June 8, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants